Conditional check for gdesktopappinfo header
authorDan Cîrnaț <dan@alt.md>
Tue, 4 May 2021 11:49:45 +0000 (13:49 +0200)
committerDan Cîrnaț <dan@alt.md>
Thu, 6 May 2021 08:38:41 +0000 (10:38 +0200)
GDesktopAppInfo is not available on macOS and needs to be disabled

config.h.meson
gdk/x11/gdkapplaunchcontext-x11.c
meson.build

index bc1d778f2ce4aa8211b58a68d8b48a294bd43d8c..56b215b012e08ad2a97683583889a3ca64d72312 100644 (file)
 #mesondefine HAVE_TRACKER3
 
 #mesondefine HAVE_F16C
+
+/* Does the OS support GDesktopAppInfo? */
+#mesondefine HAVE_DESKTOPAPPINFO
index 43c190e5e6372625bc970274ec95ed7f2a500137..b2cd99019b66997b37cb1d90e363fd4e961f4016 100644 (file)
@@ -27,7 +27,9 @@
 #include "gdkdisplay-x11.h"
 
 #include <glib.h>
+#ifdef HAVE_DESKTOPAPPINFO
 #include <gio/gdesktopappinfo.h>
+#endif
 
 #include <string.h>
 #include <unistd.h>
@@ -349,10 +351,11 @@ gdk_x11_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
     workspace_str = g_strdup_printf ("%d", ctx->workspace);
   else
     workspace_str = NULL;
-
+#ifdef HAVE_DESKTOPAPPINFO
   if (G_IS_DESKTOP_APP_INFO (info))
     application_id = g_desktop_app_info_get_filename (G_DESKTOP_APP_INFO (info));
   else
+#endif
     application_id = NULL;
 
   startup_id = g_strdup_printf ("%s-%lu-%s-%s-%d_TIME%lu",
index b0314179a84dcea29d569e90bf03e3b99013ed7f..7534e7f8d94bc33ff14c5e15a1e35bf1c2fda662 100644 (file)
@@ -177,6 +177,7 @@ check_headers = [
   'sys/time.h',
   'sys/types.h',
   'unistd.h',
+  'gio/gdesktopappinfo.h'
 ]
 
 foreach h : check_headers